<%-- 
    Document   : listadoCines
    Created on : 28-dic-2011, 2:59:43
    Author     : Bruno
--%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <div id="bodydiv">
            <span style="color: #0395CC; margin-top: 20px; font-size: 20pt; font-family: Arial;"><b>Lista de cines</b></span>
            <hr />
            <br />
            <c:if test="${not empty sessionScope.cines}">
                <table border="0">
                    <tr>
                        <td style="width: 120px; background:#a52a2a; color: #FFFFFF; border: 1px solid #444444; text-align: center;"><b>Nombre</b></td>
                        <td style="width: 240px; background:#a52a2a; color: #FFFFFF; border: 1px solid #444444; text-align: center;"><b>Direccion</b></td>
                        <td style="width: 120px; background:#a52a2a; color: #FFFFFF; border: 1px solid #444444; text-align: center;"><b>Ciudad</b></td>
                        <td style="width: 120px; background:#a52a2a; color: #FFFFFF; border: 1px solid #444444; text-align: center;"><b>Encargado</b></td>
                        <td style="width: 100px; background:#a52a2a; color: #FFFFFF; border: 1px solid #444444; text-align: center;"><b>Seleccione</b></td>
                    </tr>
                    <c:forEach var="cines" items="${sessionScope.cines}">
                        <tr>

                            <td>${cines.nombre}</td>
                            <td>${cines.direccion}</td>
                            <td>${cines.ciudad}</td>
                            <td>${cines.encargado}</td>
                            <td><a href="salasCines?id=${cines.id}" style="color:#0395CC; text-decoration:none">Ver salas</a>
                        </tr>
                    </c:forEach>
                </table>
            </c:if>
        </div>
        <c:if test="${not empty sessionScope.salas}">

            <input type="hidden" id="verificador" value="1" />
            <div id="salas">
                <table>
                    <th style="width: 120px; background:#a52a2a; color: #FFFFFF; border: 1px solid #444444; text-align: center;">Numero</th>
                    <th style="width: 120px; background:#a52a2a; color: #FFFFFF; border: 1px solid #444444; text-align: center;">Capacidad</th>
                    <th style="width: 120px; background:#a52a2a; color: #FFFFFF; border: 1px solid #444444; text-align: center;">TipoProyeccion</th>
                    <c:forEach var="salas" items="${sessionScope.salas}">
                        <tr>
                            <td style="width: 120px">${salas.numero}</td>
                            <td style="width: 120px">${salas.capacidad}</td>
                            <td style="width: 120px">${salas.tipoProyeccion}</td>
                        </tr>
                    </c:forEach>
                    <c:if test="${not empty sessionScope.error}">
                        <span style="color: red">${sessionScope.error}</span>
                    </c:if>
                </table>
            </div>
            <c:remove scope="session" var="salas" />
        </c:if>
        <jsp:include page="index.jsp" />
        <script type="text/javascript">
            $(document).ready(function(){
                
                //Verifico si se pidiron los datos de las salas para un cine y lo muestro
                if($("#verificador").val() == 1){
                    $("#salas").dialog({
                        title: 'Salas'}
                    );
                }
            });
        </script>
    </body>
</html>
